using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_DataAccessMap : EntityTypeConfiguration<t_DataAccess>
    {
        public t_DataAccessMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FType, t.FClassID });

            // Properties
            this.Property(t => t.FType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FClassID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName_CHS)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FName_CHT)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FName_EN)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FDescription_CHS)
                .IsRequired()
                .HasMaxLength(500);

            this.Property(t => t.FDescription_CHT)
                .IsRequired()
                .HasMaxLength(500);

            this.Property(t => t.FDescription_EN)
                .IsRequired()
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("t_DataAccess");
            this.Property(t => t.FType).HasColumnName("FType");
            this.Property(t => t.FClassID).HasColumnName("FClassID");
            this.Property(t => t.FName_CHS).HasColumnName("FName_CHS");
            this.Property(t => t.FName_CHT).HasColumnName("FName_CHT");
            this.Property(t => t.FName_EN).HasColumnName("FName_EN");
            this.Property(t => t.FDescription_CHS).HasColumnName("FDescription_CHS");
            this.Property(t => t.FDescription_CHT).HasColumnName("FDescription_CHT");
            this.Property(t => t.FDescription_EN).HasColumnName("FDescription_EN");
            this.Property(t => t.FSubSysID).HasColumnName("FSubSysID");
            this.Property(t => t.FState).HasColumnName("FState");
        }
    }
}
